﻿using NB.MGJ.Common.MVC;
using NB.MGJ.Model.Model;
using NB.MGJ.Service;
using NB.MGJ.Service.AntiFake;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace NB.MGJ.Web.Controllers
{
    public partial class FleeGoodsController : BaseController
    {
        private FleeGoodsService _mservice;
        private HtmlHelperService _hhservice;
        AntiFakeQueryCodeLogService _codelog = new AntiFakeQueryCodeLogService();
        public FleeGoodsController()
        {
            _mservice = new FleeGoodsService();
            _hhservice = new HtmlHelperService();
        }
        //公共textAera
        // 窜货查看物流码 公共模块 詹善福
        public ActionResult CommonBox(string filepath)
        {
            StringBuilder str = new StringBuilder();
            try
            {
                string filePath = filepath;
                //设置读取指针
                StreamReader sr = new StreamReader(filePath, Encoding.Default);
                String line;
                //循环读取
                while ((line = sr.ReadLine()) != null)
                {
                    //每读取一行后 追加并换行
                    str.Append(line.ToString() + "\r\n");
                }
                ViewBag.txt = str.ToString();
            }
            catch (Exception ex)
            {                
               // ViewBag.txt = str.Append("").ToString();
               ViewBag.txt=ex.ToString();
            }
            return View();
        }

        #region 装箱
        /// <summary>
        /// 装箱
        /// </summary>
        /// <returns></returns>
        public ActionResult PackBox()
        {
            return View();
        }

        //批量装箱
        public ActionResult BatchPacking()
        {
            return View();
        }

        //少量装箱或补箱
        public ActionResult LittlePacking()
        {
            return View();
        }
       
        #endregion        

        #region 产品出库
        /// <summary>
        /// 出库
        /// </summary>
        /// <returns></returns>
        public ActionResult OutBank()
        {
            return View();
        }
        public ActionResult OutInfo()
        {
            return View();
        }
        public ActionResult OutShowData(int? id=0)
        {
            var model = _mservice.OutShowData((int)id);
            ViewBag.model=model;
            return View(model);
        }
      

        #endregion

        #region 产品调拨

        public ActionResult ProductAllot()
        {
            return View();
        }
      
        public ActionResult AllotInfo()
        {
            return View();
        }
        public ActionResult AllotShowData(int? id)
        {
            var model = _mservice.GetShowData<V_Allocation>((int)id, "V_Allocation");
            ViewBag.model = model;
            return View(model);
            
        }

        #endregion

        #region 产品调货

        /// <summary>
        /// 产品调货
        /// </summary>
        /// <returns></returns>
        public ActionResult AdjustCargo()
        {
            return View();
        }
       
        public ActionResult CargoInfo()
        {
            return View();
        }
        public ActionResult CargoShowData()
        {
            return View();
        }
    

        #endregion

        #region 产品退货

        public ActionResult ReturnProduct()
        {
            return View();
        }
        public ActionResult ReturnProData(int? id = 0)
        {
            var model = _mservice.ProReturnShowData(id.ToString());
            ViewBag.model=model;
            return View(model);
        }
        //物流码信息
        public ActionResult CodeInfo()
        {
            return View();
        }
        
        #endregion

        #region 处理状态

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public ActionResult TransientState()
        {
            return View();
          
        }
        public ActionResult PendingReturn()
        {
            return View();

        }
      
       

        #endregion
      
    }
}